<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="inet.util.StringTool"%>
<%@page import="inet.db.tennis.TennisPhase"%>
<%@page import="java.math.BigDecimal"%>
<jsp:useBean id="tennisPhaseDAO" class="inet.db.tennis.TennisPhaseDAO" scope="session"/>
<%
	request.setCharacterEncoding("UTF-8");
	response.setCharacterEncoding("UTF-8");
	String sChampionCode = request.getParameter("championCode");
	String sSeasonId = request.getParameter("seasonId");
	String sPhaseId = request.getParameter("phaseId");
	if( sChampionCode == null || "".equals(sChampionCode)) {
		return;
	}
	if( sSeasonId == null || !StringTool.isNumberic(sSeasonId)) {
		return;
	}
	Vector<TennisPhase> vPhase = tennisPhaseDAO.findAll(sChampionCode, new BigDecimal(sSeasonId));
	if(vPhase != null && !vPhase.isEmpty()) {
		TennisPhase phase = null;
%>
	<select id="select" name="slbPhaseId" 
		onchange="loadRound('<%= request.getContextPath() %>/admin/process/load-round-of-phase.jsp',processRoundLoadData,document.formEditChampion.slbPhaseId.value);">
		<option value="0"> -Chọn giai đoạn- </option>
<%
		for (Iterator it = vPhase.iterator(); it.hasNext(); ){
			phase = (TennisPhase) it.next();
			if(phase== null) continue;
%>
			<option <%= (phase.getId().toString().equals(sPhaseId) ? "selected":"") %> value="<%= phase.getId() %>"><%=phase.getPhaseName() %></option>
<%
		}
	}
%>
	</select>